//获取应用实例
var app = getApp();
Page({
    data: {
        orderId:"",
       "isShowFootNav": false
    },
    onLoad: function (option) {
      var passCache =  app.getStorageSync(app.globalData.passCache);
	    var items='';
	    for(var i=0;i<passCache.items.length;i++){
		   var sign= i>0?';':''
		    if(passCache.items[i].category==1){
			    items+='香港,'+passCache.items[i].timesName
		    }else if(passCache.items[i].category==2){
			    items+=sign+='澳门,'+passCache.items[i].timesName
		    }
	    }
	    var isEnCode = option.type == 'enCode'?true:false
        this.setData({
          type: passCache.type,
	        bizProvinceId: passCache.bizProvinceId? passCache.bizProvinceId: passCache.birthProvinceId,

	        sensitiveCode: passCache.sensitiveMan,
	        sensitiveMan: passCache.sensitiveMan==1?'否': passCache.sensitiveMan==2?'是':'',
	        getCardWayCode: passCache.getCardWay,
	        getCardWay: passCache.getCardWay==1?'速递员上门收证':passCache.getCardWay==2?'办事处交证':'',
	        getCardPlaceName: passCache.getCardPlaceName,

	        passName: passCache.passName,
	        passCode: isEnCode&&passCache.passCode?passCache.passCode.substr(0,3)+'****'+passCache.passCode.substr(passCache.passCode.length-2,passCache.passCode.length):passCache.passCode,
	        birthday: app.toYMDDate(passCache.birthday) ,
	        validateEnd: app.toYMDDate(passCache.validateEnd),
	        birthPlace: passCache.birthPlace,
	        idCardNo: isEnCode&&passCache.idCardNo?passCache.idCardNo.substr(0,4)+'******'+passCache.idCardNo.substr(passCache.idCardNo.length-4,passCache.idCardNo.length):passCache.idCardNo,
	        orgNbr: passCache.orgNbr,
	        orgPlace: passCache.orgPlace,
	        orgName: passCache.orgName,
	        spouseName: passCache.spouseName,
	        bizShortName: passCache.bizShortName,
	        needInvoice: passCache.needInvoice==0?'不需要':'需要',
          items: items
        });
    },
    onHide:function () {
  	},
    detailTap:function (e) {
        var orderId = e.currentTarget.dataset.id;
        app.redirectTo({
            url: '../orderdetail/orderdetail?orderId='+orderId
        });
    }
});
